/**
 * 
 */
package controllers;

import models.News;
import play.Logger;
import play.mvc.Before;
import play.mvc.With;
import controllers.CRUD;

/**
 * @author ThinkPad
 *
 */
@With(Security.class)
@CRUD.For(News.class)
public class Newses extends CRUD {

	@Before(only={"create","save"})
	static void setModifier(){
		Logger.debug("moethod %s", request.actionMethod);
		if("create".equals(request.actionMethod)){
			params.put("object.creator.username", Security.connected());
			params.put("object.modifier.username", Security.connected());
		}else if("save".equals(request.actionMethod)){
			params.put("object.modifier.username", Security.connected());
		}
	
	}
}